import { NgModule,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule }   from '@angular/router';
import { FormsModule } from '@angular/forms';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import {MatButtonModule,MatInputModule} from '@angular/material';
import { CoreModule } from '../core/core.module';
import { SidebarModule } from '../sidebar/sidebar.module';
import { PublicModule } from '../public/public.module';
import { ChartModule } from 'primeng/primeng';
import { TreeTableModule } from '../public/treetable/treetable';
import { HomeComponent } from '../home/home.component';

import { DragulaModule } from 'ng2-dragula';
import { HomePageComponent } from '../home/home-page/home-page.component';
import { HomePageButtonComponent } from './home-page/home-page-button/home-page-button.component';
import { HomePageTableComponent } from './home-page/home-page-table/home-page-table.component';
import { HomePageTopComponent } from './home-page/home-page-top/home-page-top.component';

@NgModule({
  imports: [
    CommonModule,
    RouterModule,
    CoreModule,
    SidebarModule,
    MatButtonModule,
    PublicModule,
    FormsModule,
    DragulaModule,
    ChartsModule,
    TreeTableModule
  ],
  declarations: [
    HomeComponent,
    HomePageComponent,
    HomePageButtonComponent,
    HomePageTableComponent,
    HomePageTopComponent
  ],
  exports:[
    HomeComponent,
  ],
  providers:[]
})
export class HomeModule {
  constructor(@Optional() @SkipSelf() parent:HomeModule){
    if(parent){
      throw new Error('home模块已经加载，不要再次加载')
    }
  }
}
